package LambdaDemo;

public class LambdaDemo1 {
    public static void main(String[] args) {
        // Lambda 错误示范
        /*
        Animal animal = () -> {
            System.out.println("小猫会叫");
        };
        */

        // Lambda 正确示范
        Swim s1 = () -> {
            System.out.println("小猫会游泳");
        };
        s1.swimming();
    }
}

abstract class Animal{
    public abstract void cry();
}

@FunctionalInterface  // 检验接口是否只有一个抽象方法
interface Swim{
    void swimming();
}
